//OrderLine.java
package decorator.printinvoice;

/**
 * a certain line in a order invoice
 *@author:youtubezou
 *@version:2012-7-25
 */
public class OrderLine {
	private String itemName;
	private int units;
	private double unitPrices;
	

	public String toString(){
		String line = String.format("%10s\t%10d\t%10.2f\t%10.2f", 
				itemName, units, unitPrices, getTotalPrice() );
		
		return line;
	}
	
	public double getTotalPrice(){
		return unitPrices * units;
	}
	

	public String getItemName() {
		return itemName;
	}

	public void setItemName(String itemName) {
		this.itemName = itemName;
	}

	public int getUnits() {
		return units;
	}

	public void setUnits(int units) {
		this.units = units;
	}

	public double getUnitPrices() {
		return unitPrices;
	}

	public void setUnitPrices(double unitPrices) {
		this.unitPrices = unitPrices;
	}
}
